<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>修改执行人</title>
    <#include "/pubHeadStyle.html">
</head>
<body>
    <div class="ccpui-tablesize user layui-form" style="padding: 10px;">
        <table class="table-detail tableDetails">
            <tr>
                <th>当前任务</th>
                <td>
                    <input type="hidden" id="taskId"  name="taskId" value="${taskEntity.id}"/>
                    ${taskEntity.name}
                </td>
            </tr>
            <tr>
                <th>执行人</th>
                <td>
                    <input type="hidden" id="jumpUserDivHidden">
                    <div id="jumpUserDiv" style="display: inline-block;"></div>
                    <a id="jumpUserLink" class="layui-btn layui-btn-sm changeOperator" style="margin-left: 10px"><span>选择...</span> </a>
                </td>
            </tr>
            <tr>
                <th> 更改原因 </th>
                <td>
                    <textarea rows="5" cols="60" id="voteContent" name="voteContent" maxlength="512"></textarea>
                </td>
            </tr>
            <tr>
                <th>通知</th>
                <td>
                    <div class="layui-input-inline">
                        <#list handlerMap?keys as key>
                            <input id="informType" type="checkbox" class="layui-input" lay-filter="informType" name="informType" lay-skin="primary" value="${key}" checked="checked"  />
                            <span style="line-height: 44px;">
                                ${handlerMap[key].title }
                            </span>
                        </#list>
                    </div>
                </td>
            </tr>
        </table>
    </div>
<script>
    layui.config({
        base: serverPath.systemPath + staticPath.systemPath //静态资源所在路径
    }).extend({
        index: 'index' //主入口模块
    }).use(['index','layer',  'setter','form'], function (d) {
        var layer = layui.layer;
        var $ = layui.$;
        var setter = layui.setter;
        var form = layui.form;

        var dataPrivacyLevel = "${dataPrivacyLevel}";

        $("#jumpUserLink").click(function ChoiceRy(){
            var userSelectorWin;
            var body;
            layer.open({
                type:2
                ,title:'人员选择器'
                ,area:['700px','500px']
                ,btn:["保存","取消","撤销"]
                ,resize:false
                ,content: serverPath.systemPath + setter.sysLinkPath+'dialog/view/singleSysUserDialog?dataPrivacyLevel='+ dataPrivacyLevel
                ,success: function(layero, index){
                    body = layer.getChildFrame('body',index);
                    userSelectorWin = window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象，执行iframe页的方法：iframeWin.method();
                }
                ,yes:function (index,layero) {
                    //执行iframe页的save方法
                    userSelectorWin.saveData(index);
                    var theUserList = body.find("input[name=selectUser]").val();
                    if (theUserList!=="\"\"") {
                        var item = JSON.parse(theUserList);
                        var userId = item.userId;
                        var userName = item.fullName;
                        var json = {"userId": userId, "userName": userName};
                        $('#jumpUserDiv').text(userName);
                        $('#jumpUserDivHidden').val(userId);
                    }else {
                        $('#jumpUserDiv').text('');
                        $('#jumpUserDivHidden').val('');
                    }
                    layer.close(index);
                },
                btn3:function (index, layero) {
                    userSelectorWin.cancelData(index);
                    return false //开启该代码可禁止点击该按钮关闭
                }
            });
        });

    })


</script>
</body>
</html>
